# 主程序入口
from flask import Flask
from auth import auth_bp
from tasks import task_bp

app = Flask(__name__)
app.secret_key = 'secret'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

from models import db
db.init_app(app)

app.register_blueprint(auth_bp, url_prefix='/api')
app.register_blueprint(task_bp, url_prefix='/api')

with app.app_context():
    db.create_all()

if __name__ == '__main__':
    app.run(debug=True)
